
//
//  RecommendShopViewModel.swift
//  zhihuifan
//
//  Created by apple on 2017/8/18.
//  Copyright © 2017年 youyou. All rights reserved.
//

import UIKit
import YYModel
class RecommendShopViewModel{
   lazy var recommendModelList:[RecommendShopModel] = [RecommendShopModel]()
    func loadRecommendData(completion: @escaping (_ isSuccess:Bool)->()){
        HBJNetworkManager.shared.loadRecommendStore { (isSuccess, list) in
            if isSuccess {
                for  dict in list ?? []{
                    guard let model =   RecommendShopModel.yy_model(withJSON: dict) else{
                        completion(false)
                        return
                    }
                    self.recommendModelList.append(model)
                }
                completion(true)
            }else{
                completion(false)
            }

        }
    
    }
    
}
